// 导入请求实例
import request from '@/utils/request'

// 登录的API 函数
export const loginApi = (data) => {
    return request.post('/index/login', data)
}

// 注册的API 函数
export const regApi = (data) => {
    return request.post('/index/reg', data)
}

//   个人信息 
export const userInfoApi = (data) => {
    return request.post('/user/getUserInfo', data)
}

//   个人信息---性别 
export const userSexApi = (data) => {
    return request.post('/user/update', data)
}

//人个头像
export const userImgApi = (data) => {
    return request.post('/common/upload', data, {
        params: {
            "type": "images"
        }
    })
}

// 我的点赞 /user/userDataList?type=1&page=1&limit=10
export const userDataListApi = (data) => {
    return request.post('/user/userDataList?type=2', data)
}

// 我的收藏
export const userDataApi = (data) => {
    return request.post('/user/userDataList?type=1', data)
}

//  我的发布
export const userSubmitApi = (data) => {
    return request.post('/user/addArticle', data)
}

// 我的文章
export const getArticleListApi = (params) => {
    return request.get('/user/myArticle', {
        params
    })
}

// 我的文章
export const getdelArticleListApi = (id) => {
    return request.get('/user/delArticle?id=' + id)
}